home *** CD-ROM | disk | FTP | other *** search
/ BUG 1 / BUGCD1996_0708.ISO / pc / util / minilin / minilin.exe / VAR / ADM / SETUP / SETCONFI.{_1 < prev    next >
Text File  |  1994-05-06  |  8KB  |  218 lines

  1. #!/bin/sh
  2. T_PX="`cat /tmp/SeTT_PX`"
  3. ROOT_DEVICE="`cat /tmp/SeTrootdev`"
  4. if [ ! -d $T_PX/bin -a ! -d $T_PX/etc ]; then # if there no Linux here, exit
  5.  exit
  6. fi
  7. dialog --title "CONFIGURE YOUR SYSTEM?" --yesno "Now it's time to configure \
  8. your Linux system. If this is a new system, you must configure it now or it \
  9. will not boot correctly. Otherwise, you can back out to the main menu if \
  10. you're sure you want to skip this step. If you've installed a new kernel \
  11. image, it's important to reconfigure your system so that you can install LILO \
  12. (the Linux loader) or create a bootdisk using the new kernel. Do you want to \
  13. move on to \
  14. the CONFIGURE option?" 14 60 
  15. if [ $? = 1 -o $? = 255 ]; then
  16.  exit
  17. fi
  18. dialog --title "MAKE BOOT DISK?" --yesno "It is HIGHLY recommended that you make a standard boot disk \
  19. for your Linux system at this time. Such a disk can be very handy if \
  20. LILO of a kernel is ever improperly installed. Since the boot disk will \
  21. contain a kernel that is independent of LILO and the kernel on your hard drive, \
  22. you'll still be able to use it to boot your system no matter what you do to \
  23. LILO or your hard drive kernel. Would you like to make a standard \
  24. boot disk?" \
  25. 14 60
  26. if [ $? = 0 ]; then
  27.  dialog --title "BOOT DISK CREATION" --yesno \
  28. "\n\
  29. Now put a formatted floppy in your boot drive. \n\
  30. This will be made into your Linux boot disk. Use this to\n\
  31. boot Linux until LILO has been configured to boot from\n\
  32. the hard drive.\n\n\
  33. Any data on the target disk will be destroyed.\n\n\
  34. "YES" creates the disk, "NO" aborts.\n" 14 62
  35.  if [ $? = 0 ]; then
  36.   dialog --title "CREATING DISK" --infobox "Creating boot disk from 'vmlinuz'..." 5 50
  37.   KERNEL="/vmlinuz"
  38.   # echo "  - writing kernel to disk: (dd if=$T_PX$KERNEL of=/dev/fd0)"
  39.   dd if=$T_PX$KERNEL of=/dev/fd0 2> /dev/null
  40.   # echo "Configuring boot disk..."
  41.   # echo -n "  - boot device: "
  42.   rdev /dev/fd0 $ROOT_DEVICE
  43.   # echo "(rdev /dev/fd0 $ROOT_DEVICE)"
  44.   # echo -n "  - video mode: "
  45.   rdev -v /dev/fd0 -1
  46.   # echo "(rdev -v /dev/fd0 -1)"
  47.   # echo -n "  - mount root read-only: "
  48.   # echo "(rdev -R /dev/fd0 1)"
  49.   rdev -R /dev/fd0 1
  50.   sync
  51.   # echo "Boot disk created."
  52.  else
  53.   dialog --title "SKIPPED BOOT DISK CREATION" --msgbox "Boot disk creation skipped. I hope you already have a boot \
  54. disk. If you don't, you have to install LILO if you haven't already, or you'll \
  55. have a hard time booting your machine. :^)" 10 40
  56.  fi
  57. else
  58.  dialog --title "SKIPPED BOOT DISK CREATION" --msgbox "Boot disk creation skipped. I hope you already have a boot \
  59. disk. If you don't, you have to install LILO if you haven't already, or you'll \
  60. have a hard time booting your machine. :^)" 10 40
  61. fi
  62. dialog --title "MODEM CONFIGURATION" --yesno \
  63. "\n\
  64. This part of the configuration process will create a link in /dev\n\
  65. from your callout device (cua0, cua1, cua2, cua3) to /dev/modem.\n\
  66. You can change this link later if you put your modem on a different\n\
  67. port.\n\n\
  68. Would you like to set up your modem?\n" 12 73
  69. if [ $? = 0 ]; then
  70.  dialog --title "SELECT CALLOUT DEVICE" \
  71. --menu "Please select the callout device which you would like to use \
  72. for your modem:" 12 60 4 \
  73. "cua0" "com1: under DOS" \
  74. "cua1" "com2: under DOS" \
  75. "cua2" "com3: under DOS" \
  76. "cua3" "com4: under DOS" 2> /tmp/callout
  77.  if [ $? = 1 ]; then
  78.   rm -f /tmp/callout
  79.  else
  80.   MODEM_DEVICE="`cat /tmp/callout`"
  81.   rm -f /tmp/callout
  82.   (cd $T_PX/dev; ln -sf $MODEM_DEVICE modem)
  83.  fi
  84. fi
  85.  
  86.  
  87. dialog --title "MOUSE CONFIGURATION" \
  88. --yesno "\n\
  89. This part of the configuration process will create a link in /dev\n\
  90. from your mouse device to /dev/mouse. You can change this link\n\
  91. later if the setting chosen does not work, or if you switch to a\n\
  92. different type of mouse.\n\n\
  93. Would you like to set up your mouse?" 12 70
  94. if [ $? = 0 ]; then
  95.  dialog --title "SELECT MOUSE TYPE" --menu "These mouse types are supported:" 13 60 6 \
  96. "1" "Microsoft compatible serial mouse" \
  97. "2" "C&T 82C710 or PS/2 style mouse (Auxiliary port)" \
  98. "3" "Logitech Bus Mouse" \
  99. "4" "ATI XL Bus Mouse" \
  100. "5" "Microsoft Bus Mouse" \
  101. "6" "Mouse Systems serial mouse" 2> /tmp/mtype
  102.  if [ $? = 1 ]; then
  103.   rm -f /tmp/mtype
  104.  fi
  105.  if [ -f /tmp/mtype ]; then
  106.   MOUSE_TYPE="`cat /tmp/mtype`"
  107.  else
  108.   unset MOUSE_TYPE
  109.  fi
  110.  rm -f /tmp/mtype
  111.  if [ "$MOUSE_TYPE" = "1" -o "$MOUSE_TYPE" = "6" ]; then
  112.   dialog --title "SELECT SERIAL PORT" --menu "Your mouse requires a serial port. Which one would you \
  113. like to use?" 12 60 4 \
  114. "ttyS0" "com1: under DOS" \
  115. "ttyS1" "com2: under DOS" \
  116. "ttyS2" "com3: under DOS" \
  117. "ttyS3" "com4: under DOS" 2> /tmp/mport
  118.   if [ $? = 1 ]; then
  119.    rm -f /tmp/mport
  120.   fi
  121.   if [ -f /tmp/mport ]; then
  122.    MOUSE_DEVICE="`cat /tmp/mport`"
  123.   else
  124.    unset MOUSE_DEVICE
  125.   fi
  126.   rm -f /tmp/mport
  127.   if [ "$MOUSE_TYPE" = "1" ]; then
  128.    MTYPE="ms"
  129.   else
  130.    MTYPE="msc"
  131.   fi
  132.   (cd $T_PX/dev; ln -sf $MOUSE_DEVICE mouse)
  133.  elif [ "$MOUSE_TYPE" = "2" ]; then
  134.   (cd $T_PX/dev; ln -sf ps2aux mouse)
  135.   MTYPE="ps2"
  136.  elif [ "$MOUSE_TYPE" = "3" ]; then
  137.   (cd $T_PX/dev; ln -sf bmouselogitec mouse)
  138.   MTYPE="logi"
  139.  elif [ "$MOUSE_TYPE" = "4" ]; then
  140.   (cd $T_PX/dev; ln -sf bmouseatixl mouse)
  141.   MTYPE="bm"
  142.  elif [ "$MOUSE_TYPE" = "5" ]; then
  143.   (cd $T_PX/dev; ln -sf bmousems mouse)
  144.   MTYPE="bm"
  145.  fi
  146. fi
  147. export MTYPE
  148.  
  149. ( cd $T_PX ; chmod 755 ./ )
  150. ( cd $T_PX ; chmod 755 ./var )
  151. if [ -d $T_PX/usr/src/linux ]; then
  152.  chmod 755 $T_PX/usr/src/linux
  153. fi
  154. if [ ! -d $T_PX/proc ]; then
  155.  mkdir $T_PX/proc
  156.  chown root.root $T_PX/proc
  157. fi
  158. # This really should be done by the gcc.tgz package, which will know it's
  159. # own version number.
  160. #if [ -d $T_PX/usr/lib/gcc-lib/i486-linux ]; then # add the newest one
  161. # ( cd $T_PX/lib; ln -sf ../usr/lib/gcc-lib/i486-linux/*.*.*/cpp cpp )
  162. #fi
  163. if [ ! -d $T_PX/var/spool/uucp ]; then
  164.  mkdir -p $T_PX/var/spool/uucp
  165. fi
  166. chown uucp.uucp $T_PX/var/spool/uucp
  167. chmod 1777 $T_PX/var/spool/uucp
  168. if [ ! -d $T_PX/var/spool/uucppublic ]; then
  169.  mkdir -p $T_PX/var/spool/uucppublic
  170. fi
  171. chown uucp.uucp $T_PX/var/spool/uucppublic
  172. chmod 1777 $T_PX/var/spool/uucppublic
  173. chmod 1777 $T_PX/tmp
  174. if [ ! -d $T_PX/var/spool/mail ]; then
  175.  mkdir -p $T_PX/var/spool/mail
  176.  chmod 755 $T_PX/var/spool
  177.  chown root.mail $T_PX/var/spool/mail
  178.  chmod 775 $T_PX/var/spool/mail
  179. fi 
  180.  
  181. # Post installation and setup scripts added by packages.
  182. if [ -d $T_PX/var/adm/setup ]; then
  183.  for INSTALL_SCRIPTS in $T_PX/var/adm/setup/setup.*
  184.  do
  185.   SCRIPT=`basename $INSTALL_SCRIPTS`
  186.   # Here, we call each script in /var/adm/setup. Two arguments are provided:
  187.   # 1 -- the target prefix (normally /, but /mnt from the bootdisk)
  188.   # 2 -- the name of the root device.
  189.   ( cd $T_PX ; sh var/adm/setup/$SCRIPT $T_PX $ROOT_DEVICE )
  190.   if echo $SCRIPT | fgrep onlyonce 1> /dev/null 2> /dev/null; then # only run after first install
  191.    if [ ! -d $T_PX/var/adm/setup/install ]; then
  192.     mkdir $T_PX/var/adm/setup/install
  193.    fi
  194.    mv $INSTALL_SCRIPTS $T_PX/var/adm/setup/install
  195.   fi
  196.  done
  197. fi
  198.  
  199. # Load keyboard map (if any) when booting
  200. if [ -r /tmp/SeTkeymap ]; then
  201.  MAPNAME="`cat /tmp/SeTkeymap`"
  202.  if fgrep "sh /etc/rc.d/rc.keymap" $T_PX/etc/rc.d/rc.local 1> /dev/null 2> /dev/null ; then
  203.   echo >> /dev/null # ?
  204.  else
  205.   echo "# Load custom keyboard map" >> $T_PX/etc/rc.d/rc.local
  206.   echo "sh /etc/rc.d/rc.keymap" >> $T_PX/etc/rc.d/rc.local
  207.  fi
  208.  mkdir -p $T_PX/usr/lib/kbd/keytables
  209.  if [ ! -r $T_PX/usr/lib/kbd/keytables/$MAPNAME ]; then
  210.   cp /tmp/$MAPNAME $T_PX/usr/lib/kbd/keytables
  211.   chmod 755 $T_PX/usr/lib/kbd/keytables
  212.  fi
  213.  echo "#!/bin/sh" > $T_PX/etc/rc.d/rc.keymap
  214.  echo "echo 'Loading keyboard map \"$MAPNAME\"...'" >> $T_PX/etc/rc.d/rc.keymap
  215.  echo "/usr/bin/loadkeys /usr/lib/kbd/keytables/$MAPNAME" >> $T_PX/etc/rc.d/rc.keymap
  216.  chmod 755 $T_PX/etc/rc.d/rc.keymap
  217. fi
  218.